package com.huike.web.controller.business;

import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.domain.vo.BusinessTrackVo;
import com.huike.business.service.ITbBusinessTrackRecordService;
import com.huike.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.huike.common.core.controller.BaseController;

import java.util.List;

/**
 * 商机跟进记录Controller
 * @date 2021-04-28
 */
@RestController
@RequestMapping("/business/record")
public class TbBusinessTrackRecordController extends BaseController {

    @Autowired
    private ITbBusinessTrackRecordService businessTrackRecordService;

    /**
     * 通过商机id查询商机跟进记录列表
     */
    @GetMapping("list")
    public AjaxResult list(TbBusinessTrackRecord tbBusinessTrackRecord){
        List<TbBusinessTrackRecord> list= businessTrackRecordService.selectTbBusinessTrackRecordList(tbBusinessTrackRecord);
        return AjaxResult.success(list);
    }

    /**
     * 新增商机跟进记录
     */
    @PostMapping
    public AjaxResult add(@RequestBody BusinessTrackVo businessTrackVo){
        businessTrackRecordService.addTbBusinessTrackRecord(businessTrackVo);
        return AjaxResult.success();
    }


}
